Skip to content

feat: packages worker temporal scaffold#4145

Merged
epipav merged 15 commits into
feat/track-packagesfrom
feat/packages-worker-temporal-scaffold
May 26, 2026
Merged

feat: packages worker temporal scaffold#4145
epipav merged 15 commits into
feat/track-packagesfrom
feat/packages-worker-temporal-scaffold

Conversation

@epipav
Copy link
Copy Markdown
Collaborator

@epipav epipav commented May 26, 2026

Note

Medium Risk
Introduces Temporal schedules and a new worker runtime path for packages-worker; production impact is limited while workflows are placeholders, but misconfigured namespace/task queue could prevent jobs from running.

Overview
packages-worker stops being an idle process with file-based health probes and becomes a Temporal worker via @crowd/archetype-worker, aligned with other crowd workers.

On startup it registers a daily schedule (npm-registry-ingest, cron 15 3 * * *) that runs a placeholder npmHello workflow calling sayHiNpm on the packages-worker task queue—scaffolding for future npm registry ingest, not real ingest yet.

Configuration and deploy wire a dedicated packages Temporal namespace (CROWD_PACKAGES_TEMPORAL_NAMESPACE in local env and compose), set CROWD_TEMPORAL_TASKQUEUE / namespace in packages-worker scripts and Docker Compose, and add Temporal client/workflow plus archetype dependencies. The Docker image moves to bookworm-slim, installs build deps via apt, copies only archetypes/libs/packages_worker, uses a dockerignore, and adds a builder env file for the OCI image.

The github-repos-enricher path is unchanged in behavior aside from a tighter worker loop (while (nextIdx < validUrls.length) instead of unbounded while (true)) and minor formatting/logging tweaks.

Reviewed by Cursor Bugbot for commit 818b7b9. Bugbot is set up for automated code reviews on this repo. Configure here.

epipav added 8 commits May 26, 2026 17:34
Signed-off-by: anilb <epipav@gmail.com>
Signed-off-by: anilb <epipav@gmail.com>
Signed-off-by: anilb <epipav@gmail.com>
Signed-off-by: anilb <epipav@gmail.com>
Signed-off-by: anilb <epipav@gmail.com>
Signed-off-by: anilb <epipav@gmail.com>
Signed-off-by: anilb <epipav@gmail.com>
Signed-off-by: anilb <epipav@gmail.com>
Copilot AI review requested due to automatic review settings May 26, 2026 16:51
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

epipav added 4 commits May 26, 2026 18:56
This reverts commit affb6bd.

Signed-off-by: anilb <epipav@gmail.com>
Signed-off-by: anilb <epipav@gmail.com>
@epipav epipav force-pushed the feat/packages-worker-temporal-scaffold branch from 09c2822 to 4099d64 Compare May 26, 2026 16:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR converts packages_worker from an idle/health-probe process into a Temporal-backed ServiceWorker, scaffolding an initial (placeholder) npm ingest workflow + activity + cron schedule and wiring a dedicated Temporal namespace via CROWD_PACKAGES_TEMPORAL_NAMESPACE. It also updates build/deploy assets (Dockerfile, compose service env, builder definition) and applies non-functional formatting changes in the GitHub repos enricher.

Changes:

  • Replace packages-worker entrypoint with ServiceWorker Temporal worker startup and register an npm-registry-ingest Temporal Schedule.
  • Add minimal Temporal workflow/activity scaffold for npm (npmHello + sayHiNpm) and export wiring for worker registration.
  • Update Docker/build + compose/env plumbing for the packages worker (namespace/task queue env, Dockerfile changes, builder env file); minor formatting-only enricher edits.

Reviewed changes

Copilot reviewed 18 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
services/apps/packages_worker/src/workflows/index.ts Exports npmHello workflow for worker bundling/imports.
services/apps/packages_worker/src/service.ts Introduces ServiceWorker instance configured for Temporal-only operation.
services/apps/packages_worker/src/npm/workflows.ts Adds npmHello workflow calling proxied npm activities.
services/apps/packages_worker/src/npm/schedule.ts Creates Temporal Schedule npm-registry-ingest for npmHello.
services/apps/packages_worker/src/npm/activities.ts Adds placeholder npm activity sayHiNpm.
services/apps/packages_worker/src/enricher/updateEnrichedRepos.ts Formatting/import-order adjustments only.
services/apps/packages_worker/src/enricher/runEnrichmentLoop.ts Formatting-only refactors (line wrapping).
services/apps/packages_worker/src/enricher/fetchLightRepo.ts Formatting-only refactors (line wrapping).
services/apps/packages_worker/src/db.ts Import ordering change only.
services/apps/packages_worker/src/config.ts Formatting-only refactor of token parsing chain.
services/apps/packages_worker/src/bin/packages-worker.ts Switches packages-worker startup to Temporal ServiceWorker + schedule registration.
services/apps/packages_worker/src/activities.ts Re-exports npm activity for worker activity registration.
services/apps/packages_worker/package.json Adds Temporal/archetype deps and wires namespace/taskqueue into start/dev scripts.
scripts/services/packages-worker.yaml Sets task queue + namespace env for compose service.
scripts/services/docker/Dockerfile.packages-worker.dockerignore Adds ignore patterns intended to reduce Docker build context.
scripts/services/docker/Dockerfile.packages-worker Updates base image to bookworm-slim and narrows pnpm install scope; copies archetypes explicitly.
scripts/builders/packages-worker.env Adds builder definition for packages-worker image.
pnpm-lock.yaml Lockfile updates for new deps/workspace links (plus incidental metadata churn).
docs/adr/README.md Adds ADR-0003 index entry for Temporal ServiceWorker decision.
backend/.env.dist.local Adds CROWD_PACKAGES_TEMPORAL_NAMESPACE default for local runs.
backend/.env.dist.composed Adds CROWD_PACKAGES_TEMPORAL_NAMESPACE placeholder for composed envs.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/services/docker/Dockerfile.packages-worker.dockerignore
epipav added 2 commits May 26, 2026 19:03
Signed-off-by: anilb <epipav@gmail.com>
Signed-off-by: anilb <epipav@gmail.com>
Copilot AI review requested due to automatic review settings May 26, 2026 17:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 21 changed files in this pull request and generated 5 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

WORKDIR /usr/crowd/app
RUN npm install -g corepack@latest && corepack enable pnpm && corepack prepare pnpm@9.15.0 --activate

COPY ./pnpm-workspace.yaml ./pnpm-lock.yaml ./

WORKDIR /usr/crowd/app
RUN npm install -g corepack@latest && corepack enable pnpm && corepack prepare pnpm@9.15.0 --activate
RUN npm install -g corepack@latest && corepack enable pnpm && corepack prepare pnpm@9.15.0 --activate && apt update && apt install -y ca-certificates --no-install-recommends && rm -rf /var/lib/apt/lists/*
Comment thread scripts/services/packages-worker.yaml
Comment thread backend/.env.dist.composed Outdated
Comment thread services/apps/packages_worker/package.json
Signed-off-by: anilb <epipav@gmail.com>
@epipav epipav merged commit 0285989 into feat/track-packages May 26, 2026
9 checks passed
@epipav epipav deleted the feat/packages-worker-temporal-scaffold branch May 26, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants